package ch01.text04;

import ch01.Student;

import java.lang.reflect.Field;
import java.lang.reflect.Modifier;

/**
 * 其它 API
 *
 * @author V
 * @date 2025-03-18
 */
public class MainTest02 {
    public static void main(String[] args) throws Exception {
        Class<?> clazz = Student.class;

        Field nameFiled = clazz.getDeclaredField("name");

        System.out.println(nameFiled);
        // 获取字段的访问修饰符
        int modifiers = nameFiled.getModifiers();

        // todo ...
        boolean bl = Modifier.isPublic(modifiers);
        System.out.println(bl);
    }
}
